<template>
  <div>
    <div class="swiper" :class='name'>
      <div class="swiper-wrapper">
        <slot></slot>
      </div>
    </div>
  </div>
</template>
<script>
import Swiper from 'swiper/bundle'
import 'swiper/css/bundle'
export default {
  props: {
    preview: {
      type: Number,
      default: 3.5
    },
    name: {
      type: String,
      default: 'swiper'
    }
  },
  mounted () {
    new Swiper('.' + this.name, {
      slidesPerView: this.preview,
      spaceBetween: 10,
      freeMode: true
    })
  }
}
</script>
